package multi.SAUNA;

import org.metacsp.multi.activity.Activity;
import org.metacsp.multi.activity.ActivityNetworkSolver;
import org.metacsp.multi.allenInterval.AllenIntervalConstraint;
import org.metacsp.multi.allenInterval.AllenIntervalNetworkSolver;
import org.metacsp.multi.symbols.SymbolicValueConstraint;
import org.metacsp.multi.symbols.SymbolicVariableConstraintSolver;
import org.metacsp.framework.ConstraintSolver;
import org.metacsp.framework.Variable;
import org.metacsp.framework.multi.MultiConstraintSolver;

public class TemporalPolyhedronNetworkSolver extends MultiConstraintSolver {

	protected int IDs = 0;
	protected long origin = 0, horizon = 10000;
	
	protected static int MAX_ACTIVITIES = 500;
	
	public long getHorizon() {return horizon;}
	public long getOrigin() {return origin;}

	/**
	 * 
	 */
	private static final long serialVersionUID = -5393466238553114203L;

//	public SpatioTemporalPolygonNetworkSolver(long origin, long horizon) {
//		super(origin, horizon);
//		//this.variableTypes = new Class<?>[] {SpatioTemporalPolygon.class};
//		// TODO Auto-generated constructor stub
//	}
	
	public TemporalPolyhedronNetworkSolver(long origin, long horizon) {
		super(new Class[] {AllenIntervalConstraint.class, SymbolicValueConstraint.class}, TemporalPolyhedron.class, createConstraintSolvers(origin,horizon,500), new int[] {1,1});
		this.origin = origin;
		this.horizon = horizon;
	}

	protected static ConstraintSolver[] createConstraintSolvers(long origin, long horizon, int numActivities) {
		ConstraintSolver[] ret = new ConstraintSolver[] {new AllenIntervalNetworkSolver(origin, horizon, numActivities), new SymbolicVariableConstraintSolver()};
		return ret;
	}

	@Override
	public boolean propagate() {
		return true;
	}

//	@Override
//	protected Variable[] createVariablesSub(int num) {
//		Variable[] ret = new Variable[num];
//		for (int i = 0; i < num; i++)
//			ret[i] = new SpatioTemporalPolygon(this, IDs++, this.constraintSolvers); 
//		return ret;
//	}

}
